home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 33
/
Volume 33 - JOGO DISK .iso
/
Games
/
shoot_em_in.swf
/
scripts
/
DefineSprite_136
/
frame_22
/
DoAction.as
Wrap
Text File
|
2007-01-15
|
3KB
|
82 lines
vAngleMin = 10;
vAngleMax = 40;
vLenghtMin = 0.3;
vLenghtMax = 0.95;
vGravity = 0.0098;
vDiv = 1.5;
vDivEffect = 1.1;
vDivBut = 10;
vDivGoal = 5;
lGoalSide = 0;
lcol1 = 0;
lcol2 = 0;
lcol3 = 0;
_parent.mcbut.gotoAndStop("game");
ltest = 0;
lbut = 0;
ltestBut = 0;
var i = 1;
while(vNBWall >= i)
{
vTestWall[i] = 0;
i++;
}
vTestGoal = 0;
vTestgoal2 = 0;
vTestgoal3 = 0;
vxgoal = 0;
v2DPoint = WorldToScreen(vxgoal,vygoal,vzgoal,_Focale,_scale,_xoffset,_yoffset);
_parent.mcgoal.gotoAndStop("stand-up");
_parent.mcgoal._x = v2DPoint.x;
_parent.mcgoal._y = v2DPoint.y;
_parent.mcgoal._xscale = v2DPoint.z * 2 * lplayerHeight;
_parent.mcgoal._yscale = v2DPoint.z * 2 * lplayerHeight;
lgoalleft = 0;
lgoalright = 0;
vXPlayer = vXPlayerStart;
vYPlayer = vYPlayerStart;
vZPlayer = vZPlayerStart;
vXBall = vXBallStart;
vYBall = vYBallStart;
vZBall = vZBallStart;
vxgoal = v3DPoint2.x;
vygoal = v3DPoint2.y;
vzgoal = v3DPoint2.z;
vrgoal = v3DPoint2.scale;
vtestgoal = 0;
v2DPoint = WorldToScreen(vXBall,vYBall,vZBall,_Focale,_scale,_xoffset,_yoffset);
_parent.mcball._x = v2DPoint.x;
_parent.mcball._y = v2DPoint.y;
_parent.mcball._xscale = v2DPoint.z * 2 * ldball;
_parent.mcball._yscale = v2DPoint.z * 2 * ldball;
v2DPoint = WorldToScreen(vXBall,_Yfloor + 0.05,vZBall,_Focale,_scale,_xoffset,_yoffset);
_parent.mcShadow._x = v2DPoint.x;
_parent.mcShadow._y = v2DPoint.y;
_parent.mcShadow._xscale = v2DPoint.z * 4 * ldball;
_parent.mcShadow._yscale = v2DPoint.z * 2 * ldball;
vangle = langle3 * lsens;
vanglebut = langle;
vangleplayer = langle2;
vdist = Math.sqrt((vXPlayer - vXBall) * (vXPlayer - vXBall) + (vYPlayer - vYBall) * (vYPlayer - vYBall) + (vZPlayer - vZBall) * (vZPlayer - vZBall));
vdistbut = Math.sqrt(vXBall * vXBall + (vZBall - 50) * (vZBall - 50));
vVectorLenght = vLenghtMin + (vLenghtMax - vLenghtMin) * vdist / (ldzone / 2);
vVectorRot = vAngleMax - (vAngleMax - vAngleMin) * vdist / (ldzone / 2);
vVectorRot = vVectorRot / 180 * 3.141592653589793;
vYVector = 0 * Math.cos(- vVectorRot) + vVectorLenght * Math.sin(- vVectorRot);
vZVector = vVectorLenght * Math.cos(- vVectorRot) + 0 * Math.sin(- vVectorRot);
var lZvector = vZVector;
vXVector = 0 * Math.cos(- vanglebut) + lZvector * Math.sin(- vanglebut);
vZVector = (- lZvector) * Math.cos(- vanglebut) + 0 * Math.sin(- vanglebut);
vXVectorEffect = vangle / 100;
vmaxframes = 18;
vnbframes = int(vmaxframes * vdist / (ldzone / 2));
if(0 >= vnbFrames)
{
vnbframes = 1;
}
vnbframes2 = vnbframes;
vx2 = (vXBall - vXPlayer) / vnbframes;
vz2 = (vZBall - vZPlayer) / vnbframes;
_parent.mcplayer.mcanim.gotoAndStop("run");
this.gotoAndStop("run2");